// 元组: useState函数
function useState<Type>(initialState: Type): [Type, (newState: Type) => void] {
  let state = initialState
  function setState(newState: Type) {
    state = newState
  }

  return [state, setState]
}

// 初始化counter
const [counter, setCounter] = useState(100)
const [message, setMessage] = useState('Hello World')
const [isOnline, setIsOnline] = useState<any[]>([])

setCounter(9)

console.log(counter)

export {}
